package _99练习;

<<<<<<< HEAD
/**
 * @author ZhiCheng Qian
 * @since 2021/11/30 0:22
 */
=======

>>>>>>> 1c69d32fc055e0010098b09f71795769d9a12acd
public class synchronizedTest {
	public static void main(String[] args) {

		// synchronized (this){}
//        synchronizedDemo1 s1 = new synchronizedDemo1();

		// 同步方法 在方法前添加 synchronized
//        synchronizedDemo2 s1 = new synchronizedDemo2();

		// 创建锁对象
		// Lock l = new ReentrantLock();
		// l.tryLock()
		synchronizedDemo3 s1 = new synchronizedDemo3();

		Thread t1 = new Thread(s1);
		t1.setName("大明");
		Thread t2 = new Thread(s1);
		t2.setName("小明");

		t1.start();
		t2.start();

	}
}
